package com.tianji.learning.controller;


import com.tianji.common.domain.dto.PageDTO;
import com.tianji.learning.domain.query.ReplyPageQuery;
import com.tianji.learning.domain.vo.ReplyVO;
import com.tianji.learning.service.IInteractionReplyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 互动提问的回复表 前端控制器
 * </p >
 *
 * @author
 * @since 2024-03-21
 */
@RestController
@RequestMapping("/admin/replies")
@RequiredArgsConstructor
@Api(tags = "互动问答-管理端-回复相关接口")
public class InteractionReplyAdminController {
    private final IInteractionReplyService replyService;

    /**
     * 分页查询回答或评论列表
     */
    @GetMapping("page")
    @ApiOperation("分页查询回答或评论列表")
    public PageDTO<ReplyVO> pageQueryAdmin(ReplyPageQuery query){
        return replyService.adminPageQuery(query);
    }


    /**
     * 修改回答或评论的隐藏状态
     */
    @ApiOperation("修改回答或评论的隐藏状态")
    @PutMapping("{id}/hidden/{hidden}")
    public void updateHiddenById(@PathVariable Long id, @PathVariable Boolean hidden){
        replyService.updateHiddenById(id, hidden);
    }

}



